import { createRouter, createWebHistory } from 'vue-router'

import UserLogin from '../views/UserLogin.vue'
import AdminLogin from '../views/AdminLogin.vue'
import Register1 from '../views/Register1.vue'
import Register from '../views/Register.vue'
import Backend from '../views/Backend.vue'

//-------------------------------------------------
import IdCode from '../components/UCenter/IdCode.vue'
import IdCode1 from '../components/UCenter/IdCode1.vue'
import Ac from '../components/UCenter/login/Ac.vue'
import Ph from '../components/UCenter/login/Ph.vue'
import We from '../components/UCenter/login/We.vue'
import ForgetPwd from '../components/UCenter/login/ForgetPwd.vue'
//------------------------------------------main内容---------------
import Welcome from '../components/UCenter/mainbody/Welcome.vue'
import User from '../components/UCenter/mainbody/user/User.vue'
import AdminSetting from '../components/UCenter/mainbody/admin/AdminSetting.vue'
import SlideVerify  from '../components/UCenter/save/slideVerify.vue'
import PicVerify from '../components/UCenter/save/picVerify.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    //-------------------------------------主要页面---------------
    {path: '/user', name: 'user', component: UserLogin },
    { path: '/admin', name: 'admin', component: AdminLogin ,meta:{title:'admin登录',keepAlive:true}},
    { path: '/register', name: 'register', component: Register },
    { path: '/register1', name: 'register1', component: Register1 },
    { path: '/backend', name: 'backend', component: Backend },
    
    // ---------------------------------------组件---------------------
    { path: '/idcode', name: 'idcode', component: IdCode },
    { path: '/idcode1', name: 'idcode1', component: IdCode1 },
    { path: '/ac', name: 'ac', component: Ac, meta: { title: 'account登录', keepAlive: true } },
    { path: '/ph', name: 'ph', component: Ph },
    { path: '/we', name: 'we', component: We ,meta: { title: 'email登录', keepAlive: true } },
    { path: '/forget', name: 'forget', component: ForgetPwd },
    { path: '/verify', name: 'verify', component: SlideVerify },
    { path: '/pic', name: 'pic', component: PicVerify },
    //------------------------------------------main组件---------------
    { path: '/welcome', name: 'welcome', component: Welcome },
    { path: '/user', name: 'user', component: User },
    { path: '/adminSetting', name: 'adminSetting', component: AdminSetting },

    
  ]
})

export default router
